package com.sky.mapper;

import com.sky.entity.SetmealDish;
import com.sky.vo.DishItemVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * ClassName: SetMealDishMapper
 * Description: com.sky.mapper
 */
@Mapper
public interface SetMealDishMapper {


    /**
     * 获取菜品被关联中套餐表的套餐id
     * @param DishIds
     * @return
     */
    List<Long> getSetMealIdsByDishIds(List<Long> DishIds);

    /**
     * 向套餐菜品表插入一条或者多条数据
     * @param dishes
     */
    void insertBatch(List<SetmealDish> dishes);

    /**
     * 删除套餐关联的菜品
     * @param setmealId
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetMealId(Long setmealId);

    /**
     * 获取套餐菜品表中的菜品名
     * @param setmealId
     * @return
     */
    List<String> getDishNameBysetmealId(Long setmealId);

    /**
     * 查询套餐菜品
     * @param id
     * @return
     */
    List<SetmealDish> getDishBySetmealId(Long id);

    /**
     * 根据套餐id查询包含的菜品
     * @param id
     * @return
     */
    List<DishItemVO> dishList(Long id);
}
